﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Cole.Entities;
using Cole.Service;

namespace Cole.GUI.Grado_Seccion
{
    public partial class FrmNuevaSeccion : Form
    {
        private IGradoBl gradoBl;        
        public FrmNuevaSeccion()
        {
            InitializeComponent();
            if (gradoBl == null)
            {
                gradoBl = new GradoBl();
            }
        }

        private void FrmNuevaSeccion_Load(object sender, EventArgs e)
        {
            gradoBindingSource.DataSource = gradoBl.GetAllGrado();
        }
        public void nuevo()
        {
            gradoSeccionBindingSource.AddNew();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            var grado = gradoSeccionBindingSource.Current as GradoSeccion;
            gradoBl.ModificarGrado(grado);
            Close();
        }
    }
}
